{include file="public/head"}
<body>
<div class="header">
    <div class="header-left" onclick="javascript:history.back(-1);">
        <i class="iconfont iconfanhui"></i>
    </div>
<!--    <div class="header-center">微信支付</div>-->
    <div class="header-right"></div>
</div>
<style>
    #qrcode img{
        width: 200px;
        height: 200px;
    }

    #wxzf{
        display: inline-block;
        width: 50%;
        height: 50px;
        padding: 5px 0;
        background: rgb(81,195,50);
        border-radius: 8px;
        outline: none;
        color: #fff;
        font-size: 1.2em;
        border:none;
    }
</style>
<b class="line"></b>
<div class="center">
    <div class="col-main">
        <div class="main-wrap">

            <!--进度条-->

            <div class="am-cf am-padding" style="text-align: center;margin-top: 5rem;">

                <p style="font-size: 2em;font-weight: bold;margin-bottom: 2em">￥{$total_money}</p>

                <button id="wxzf" onclick="callpay()">微信支付</button>
            </div>
        </div>
    </div>
</div>
{include file="public/footer"}
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script type="text/javascript">
    function jsApiCall()
    {
        WeixinJSBridge.invoke(
            'getBrandWCPayRequest',
        <?php echo $jsApiParameters; ?>,
        function(res){
            WeixinJSBridge.log(res.err_msg);
            // alert(res.err_code+res.err_desc+res.err_msg);
            if(res.err_msg=="get_brand_wcpay_request:ok"){
                alert('支付成功');
                location.href="/";
            }
        }
    );
    }

    function callpay()
    {


        if (typeof WeixinJSBridge == "undefined"){
            if( document.addEventListener ){
                document.addEventListener('WeixinJSBridgeReady', jsApiCall, false);
            }else if (document.attachEvent){
                document.attachEvent('WeixinJSBridgeReady', jsApiCall);
                document.attachEvent('onWeixinJSBridgeReady', jsApiCall);
            }
        }else{
            jsApiCall();
        }
    }
</script>
</body>

</html>